<template>
      <ele-pro-table style="margin-top: 20px" emptyText="当前任务未绑定设备" ref="table" :parseData="parseData" :toolbar="false" :columns="columns" :datasource="url" :where="where" height="calc(90vh - 315px)">
        <template slot="index" slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </ele-pro-table>
</template>

<script>
import {mapGetters} from "vuex";
// import CustomImage from '@/components/CustomImage.vue'

export default {
  props:['id'],
  components: {
    // CustomImage
  },
  name: 'SystemLevel',
  computed: {
    ...mapGetters(["permission"]),
    url(){
      return `/tasks/${this.id}/products`
    }
  },
  data() {
    return {
      task_id:null,
      // 表格列配置
      columns: [
        {
          slot: 'index',
          label: '序号',
          width: 60,
          align: 'center',
          fixed: "left",
          emptyText: '暂无',

        },
        {
          prop: 'name',
          label: '出厂编号',
          // width: 200,
          align: 'center',
          showOverflowTooltip: true,
          emptyText: '暂无',
        },
      ],
      // 表格搜索条件
      where: {},
      /*详情*/
      visible: false,
      /*图片*/
      info: {},
    };
  },
  mounted() {
    this.reload()
  },
  methods: {
    parseData(res){
      if(res.code===-1||res.data===null){
        res.data=[]
      }
      return res
    },
    /* 刷新表格 */
    reload() {
      this.$refs.table.reload({where: this.where});
    },
    /* 重置搜索 */
    reset() {
      this.current = {}
      this.where = {};
      this.reload();
    },

  }
}
</script>

<style scoped>
.date /deep/ .el-input {
  width: 100%;
}

.el-row {
  height: 36px;
}
</style>
